/**
 * 성적 관련된 자바스크립트 
 * date : 2014.11 
 * author:pwg
 */
var url='index.jsp?inc=./member/';

function general() { //  공통 모듈
	
	if(document.getElementById('btnList') != null) {
		document.getElementById('btnList').onclick = function() {
			var frm = document.memberFrm;
			frm.action = url+'list.jsp';
			frm.submit();
		}
	}
	
	if(document.getElementById('btnInput') !=null){
		document.getElementById('btnInput').onclick = function() {
			var frm = document.memberFrm;
			frm.action = url+'input.jsp';
			frm.submit();
		}
	}
	if(document.getElementById('btnModify') !=null){
		document.getElementById('btnModify').onclick = function() {
			var frm = document.memberFrm;
			frm.action = url+'modify.jsp';
			frm.submit();
		}
	}
	if(document.getElementById('btnDelete') !=null){
		document.getElementById('btnDelete').onclick = function() {
			var b = confirm("정말 삭제하시겠습니까 ???");
			if(b){
				var f = document.memberFrm;
				f.action = url + 'delete_result.jsp';
				f.submit();
			}else{
				alert("삭제작업이 취소되었습니다.");
			}
		}
	}
	if(document.getElementById('btnView') !=null){
		document.getElementById('btnView').onclick = function() {
			var f = document.memberFrm;
			f.action = url + 'view.jsp';
			f.submit();
		}
	}
	
}

function goPage(page){
	var mf = document.memberFrm;
	mf.nowPage.value = page;
	mf.action = 'index.jsp?inc=./member/list.jsp';
	
	mf.submit();
	
}
function goView(page, mid){
	var mf = document.memberFrm;
	mf.nowPage.value = page;
	mf.mid.value = mid;
	mf.action = url+ 'view.jsp';
	
	mf.submit();
	
}



function inputInit() { // input과 관련된 모듈
	general();
	document.getElementById('btnSave').onclick=function(){
		var f = document.memberFrm;
		f.action= url + 'input_result2.jsp';
		if(f.mid.value == ''){
			alert('아디이를 입력하세요....');
			f.mid.focus();
		}else{
			f.submit();
		}
	}
	
}
function listInit() {
	general();
}



function viewInit(){
	general();
}
function modifyInit(){
	general();
	document.getElementById('btnSave').onclick=function(){
		var f=document.memberFrm;
		f.action = url + 'modify_result.jsp';
		if(f.mid.value == ''){
			alert('아이디를 입력하세요...');
			f.mid.focus();
		}else{
			f.submit();
		}
	}
}
function deleteInit(){
	general();
}




